package com.system.config;

import java.util.function.Predicate;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 增加前缀
 * @author kaifa002
 *
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
 
    @Override
    public void configurePathMatch(PathMatchConfigurer configurer) {
        // 注解，判断Controller上是否包含某个注解
        // configurer.addPathPrefix(apiPrefix.getFlow(), c -> c.isAnnotationPresent(ApiPrefixFlowRestController.class));

    	Predicate<Class<?>> flag = new Predicate<Class<?>>() {
			@Override
			public boolean test(Class<?> t) {
				return false;
			}
		};
		configurer.addPathPrefix("v", flag);
    	// configurer.addPathPrefix("v", t -> true);
		
    }
    
    
}